<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>鸿蒙教育平台 - 就业信息管理系统</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'HarmonyOS Sans SC', 'Segoe UI', 'PingFang SC', sans-serif;
        }
        
        :root {
            --primary: #3498db;
            --primary-dark: #2980b9;
            --secondary: #2ecc71;
            --secondary-dark: #27ae60;
            --accent: #9b59b6;
            --dark: #2c3e50;
            --light: #f8f9fa;
            --gray: #7f8c8d;
            --light-gray: #ecf0f1;
            --danger: #e74c3c;
            --warning: #f39c12;
            --success: #2ecc71;
        }
        
        body {
            background: linear-gradient(135deg, #1a2980, #26d0ce);
            background-size: 400% 400%;
            animation: gradientBG 15s ease infinite;
            color: #333;
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }
        
        @keyframes gradientBG {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        
        .container {
            width: 100%;
            max-width: 1400px;
            background: rgba(255, 255, 255, 0.97);
            border-radius: 20px;
            box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            min-height: 90vh;
        }
        
        /* 头部样式 */
        header {
            background: var(--dark);
            color: white;
            padding: 15px 40px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: relative;
            z-index: 10;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }
        
        .logo {
            display: flex;
            align-items: center;
            gap: 15px;
        }
        
        .logo i {
            font-size: 32px;
            color: var(--primary);
        }
        
        .logo-text {
            display: flex;
            flex-direction: column;
        }
        
        .logo h1 {
            font-size: 26px;
            font-weight: 700;
            letter-spacing: 0.5px;
        }
        
        .logo p {
            font-size: 14px;
            opacity: 0.8;
        }
        
        .auth-section {
            display: flex;
            gap: 20px;
            align-items: center;
        }
        
        .user-info {
            display: flex;
            align-items: center;
            gap: 10px;
            background: rgba(255, 255, 255, 0.1);
            padding: 8px 15px;
            border-radius: 30px;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .user-info:hover {
            background: rgba(255, 255, 255, 0.2);
        }
        
        .user-info img {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid var(--primary);
        }
        
        .user-details {
            display: flex;
            flex-direction: column;
        }
        
        .user-name {
            font-weight: 600;
            font-size: 16px;
        }
        
        .user-role {
            font-size: 13px;
            color: #aaa;
        }
        
        .login-btn {
            background: var(--primary);
            color: white;
            border: none;
            padding: 10px 25px;
            border-radius: 30px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.3s;
            font-size: 15px;
        }
        
        .login-btn:hover {
            background: var(--primary-dark);
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        }
        
        /* 主内容区域 */
        .main-content {
            display: flex;
            flex: 1;
        }
        
        /* 侧边栏 */
        .sidebar {
            width: 250px;
            background: white;
            padding: 30px 0;
            border-right: 1px solid var(--light-gray);
            box-shadow: 5px 0 15px rgba(0, 0, 0, 0.05);
            display: flex;
            flex-direction: column;
        }
        
        .nav-title {
            padding: 0 25px 15px;
            font-size: 16px;
            color: var(--gray);
            font-weight: 600;
        }
        
        .nav-links {
            list-style: none;
            flex: 1;
        }
        
        .nav-links li {
            padding: 14px 25px;
            transition: all 0.3s;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 15px;
            font-size: 16px;
            font-weight: 500;
            color: #555;
        }
        
        .nav-links li:hover, .nav-links li.active {
            background: #f5f9ff;
            border-left: 4px solid var(--primary);
            color: var(--primary);
        }
        
        .nav-links li i {
            width: 24px;
            text-align: center;
            font-size: 18px;
        }
        
        /* 内容区域 */
        .content {
            flex: 1;
            padding: 30px;
            background: var(--light);
            display: flex;
            flex-direction: column;
        }
        
        .content-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
            padding-bottom: 20px;
            border-bottom: 1px solid var(--light-gray);
        }
        
        .page-title {
            font-size: 26px;
            font-weight: 700;
            color: var(--dark);
            display: flex;
            align-items: center;
            gap: 15px;
        }
        
        .filters {
            display: flex;
            gap: 15px;
            background: white;
            padding: 10px 15px;
            border-radius: 10px;
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
        }
        
        .filter-item {
            display: flex;
            flex-direction: column;
        }
        
        .filter-item label {
            font-size: 13px;
            color: var(--gray);
            margin-bottom: 5px;
        }
        
        .filter-item select, .filter-item input {
            border: 1px solid var(--light-gray);
            padding: 8px 12px;
            border-radius: 6px;
            min-width: 150px;
            background: white;
            font-size: 14px;
        }
        
        .search-bar {
            display: flex;
            background: white;
            border-radius: 30px;
            padding: 8px 15px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            width: 300px;
            border: 1px solid var(--light-gray);
        }
        
        .search-bar input {
            border: none;
            outline: none;
            flex: 1;
            padding: 0 10px;
            font-size: 15px;
        }
        
        .search-bar button {
            background: none;
            border: none;
            color: var(--primary);
            cursor: pointer;
            font-size: 16px;
        }
        
        /* 卡片样式 */
        .stats-cards {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }
        
        .stat-card {
            background: white;
            border-radius: 15px;
            padding: 25px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            display: flex;
            flex-direction: column;
            transition: all 0.3s;
        }
        
        .stat-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
        }
        
        .stat-title {
            font-size: 16px;
            color: var(--gray);
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .stat-value {
            font-size: 32px;
            font-weight: 700;
            color: var(--dark);
            margin: 5px 0;
        }
        
        .stat-change {
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .positive {
            color: var(--success);
        }
        
        .negative {
            color: var(--danger);
        }
        
        /* 图表区域 */
        .charts-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
            gap: 25px;
            margin-bottom: 30px;
        }
        
        .chart-card {
            background: white;
            border-radius: 15px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            padding: 25px;
            height: 350px;
        }
        
        .chart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        
        .chart-title {
            font-size: 18px;
            font-weight: 600;
            color: var(--dark);
        }
        
        /* 数据表格 */
        .data-section {
            background: white;
            border-radius: 15px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            padding: 25px;
            margin-bottom: 30px;
            flex: 1;
            display: flex;
            flex-direction: column;
        }
        
        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 25px;
        }
        
        .section-title {
            font-size: 20px;
            font-weight: 700;
            color: var(--dark);
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .section-actions {
            display: flex;
            gap: 15px;
        }
        
        .section-actions button {
            background: var(--primary);
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.3s;
        }
        
        .section-actions button:hover {
            background: var(--primary-dark);
            transform: translateY(-2px);
        }
        
        .data-table-container {
            flex: 1;
            overflow: auto;
        }
        
        .data-table {
            width: 100%;
            border-collapse: collapse;
            min-width: 1000px;
        }
        
        .data-table th {
            background: #f8f9fa;
            text-align: left;
            padding: 15px;
            font-weight: 600;
            color: var(--dark);
            border-bottom: 1px solid var(--light-gray);
            position: sticky;
            top: 0;
        }
        
        .data-table td {
            padding: 15px;
            border-bottom: 1px solid var(--light-gray);
        }
        
        .data-table tr:hover {
            background-color: #f5f9ff;
        }
        
        .status-badge {
            padding: 5px 12px;
            border-radius: 20px;
            font-size: 13px;
            font-weight: 500;
            display: inline-block;
        }
        
        .status-employed {
            background: #e1f3e6;
            color: var(--success);
        }
        
        .status-job-seeking {
            background: #fef5e7;
            color: var(--warning);
        }
        
        .status-higher-edu {
            background: #f4e8fd;
            color: var(--accent);
        }
        
        .status-entrepreneur {
            background: #e6f7ff;
            color: var(--primary);
        }
        
        /* 登录面板 */
        .login-panel {
            width: 100%;
            max-width: 450px;
            margin: 0 auto;
            padding: 40px;
            background: white;
            border-radius: 20px;
            box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
            text-align: center;
        }
        
        .login-panel h2 {
            font-size: 28px;
            color: var(--dark);
            margin-bottom: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 15px;
        }
        
        .role-selector {
            display: flex;
            margin-bottom: 30px;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }
        
        .role-option {
            flex: 1;
            padding: 20px;
            background: #f8f9fa;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .role-option.active {
            background: var(--primary);
            color: white;
        }
        
        .role-option i {
            font-size: 32px;
            margin-bottom: 15px;
        }
        
        .role-option h3 {
            font-size: 18px;
            font-weight: 600;
        }
        
        .input-group {
            margin-bottom: 20px;
            text-align: left;
        }
        
        .input-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            color: var(--dark);
        }
        
        .input-group input {
            width: 100%;
            padding: 15px;
            border: 1px solid var(--light-gray);
            border-radius: 10px;
            font-size: 16px;
            transition: all 0.3s;
        }
        
        .input-group input:focus {
            border-color: var(--primary);
            outline: none;
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
        }
        
        .login-btn-panel {
            width: 100%;
            padding: 16px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 10px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            margin-top: 20px;
        }
        
        .login-btn-panel:hover {
            background: var(--primary-dark);
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        }
        
        .system-info {
            margin-top: 25px;
            color: var(--gray);
            font-size: 14px;
            line-height: 1.6;
        }
        
        /* 响应式设计 */
        @media (max-width: 1200px) {
            .charts-container {
                grid-template-columns: 1fr;
            }
            
            .sidebar {
                width: 70px;
            }
            
            .nav-title, .nav-links li span {
                display: none;
            }
            
            .nav-links li {
                justify-content: center;
                padding: 18px 10px;
            }
        }
        
        @media (max-width: 992px) {
            .filters {
                flex-wrap: wrap;
            }
            
            .filter-item {
                min-width: 140px;
            }
        }
        
        @media (max-width: 768px) {
            .content-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 20px;
            }
            
            .filters {
                flex-direction: column;
                width: 100%;
            }
            
            .search-bar {
                width: 100%;
            }
            
            .stats-cards {
                grid-template-columns: 1fr;
            }
            
            .section-actions {
                flex-direction: column;
                width: 100%;
                margin-top: 15px;
            }
            
            .section-actions button {
                width: 100%;
            }
            
            .data-table {
                min-width: 800px;
            }
            
            .login-panel {
                padding: 30px 20px;
            }
        }
        
        /* 动画效果 */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .animated {
            animation: fadeIn 0.6s ease forwards;
        }
        
        .delay-1 { animation-delay: 0.1s; }
        .delay-2 { animation-delay: 0.2s; }
        .delay-3 { animation-delay: 0.3s; }
        .delay-4 { animation-delay: 0.4s; }
        
        .hidden {
            display: none;
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- 登录面板 -->
        <div id="loginPanel" class="login-panel animated">
            <h2><i class="fas fa-user-lock"></i> 鸿蒙教育平台登录</h2>
            <div class="role-selector">
                <div class="role-option active" id="studentRole">
                    <i class="fas fa-user-graduate"></i>
                    <h3>学生登录</h3>
                </div>
                <div class="role-option" id="teacherRole">
                    <i class="fas fa-chalkboard-teacher"></i>
                    <h3>教师登录</h3>
                </div>
            </div>
            
            <div class="input-group">
                <label for="username">学号/工号</label>
                <input type="text" id="username" placeholder="请输入学号或工号">
            </div>
            
            <div class="input-group">
                <label for="password">密码</label>
                <input type="password" id="password" placeholder="请输入密码">
            </div>
            
            <button class="login-btn-panel" onclick="login()">登录系统</button>
            
            <div class="system-info">
                <p><i class="fas fa-info-circle"></i> 提示：学生账号使用学号登录，教师账号使用工号登录</p>
                <p><i class="fas fa-key"></i> 初始密码：123456</p>
            </div>
        </div>
        
        <!-- 主应用（登录后显示） -->
        <div id="mainApp" class="hidden">
            <header>
                <div class="logo">
                    <i class="fas fa-graduation-cap"></i>
                    <div class="logo-text">
                        <h1>鸿蒙教育平台</h1>
                        <p>就业信息管理系统</p>
                    </div>
                </div>
                
                <div class="auth-section">
                    <div class="user-info" onclick="logout()">
                        <img src="https://randomuser.me/api/portraits/men/41.jpg" alt="用户头像">
                        <div class="user-details">
                            <div class="user-name" id="currentUserName">张老师</div>
                            <div class="user-role" id="currentUserRole">计算机学院 - 教授</div>
                        </div>
                    </div>
                    <button class="login-btn" onclick="logout()">
                        <i class="fas fa-sign-out-alt"></i> 退出登录
                    </button>
                </div>
            </header>
            
            <div class="main-content">
                <div class="sidebar">
                    <div class="nav-title">导航菜单</div>
                    <ul class="nav-links">
                        <li class="active">
                            <i class="fas fa-home"></i>
                            <span>控制面板</span>
                        </li>
                        <li>
                            <i class="fas fa-user-graduate"></i>
                            <span>学生管理</span>
                        </li>
                        <li>
                            <i class="fas fa-chart-line"></i>
                            <span>就业数据分析</span>
                        </li>
                        <li>
                            <i class="fas fa-briefcase"></i>
                            <span>就业信息管理</span>
                        </li>
                        <li>
                            <i class="fas fa-building"></i>
                            <span>企业合作</span>
                        </li>
                        <li>
                            <i class="fas fa-cog"></i>
                            <span>系统设置</span>
                        </li>
                    </ul>
                </div>
                
                <div class="content">
                    <div class="content-header">
                        <div class="page-title">
                            <i class="fas fa-briefcase"></i>
                            <span id="pageTitle">就业信息管理</span>
                        </div>
                        
                        <div class="filters" id="teacherFilters">
                            <div class="filter-item">
                                <label>学院</label>
                                <select id="collegeFilter">
                                    <option>全部学院</option>
                                    <option>计算机学院</option>
                                    <option>经济管理学院</option>
                                    <option>机械工程学院</option>
                                    <option>外国语学院</option>
                                </select>
                            </div>
                            
                            <div class="filter-item">
                                <label>班级</label>
                                <select id="classFilter">
                                    <option>全部班级</option>
                                    <option>计算机2001</option>
                                    <option>计算机2002</option>
                                    <option>软件2001</option>
                                    <option>软件2002</option>
                                    <option>人工智能2001</option>
                                </select>
                            </div>
                            
                            <div class="filter-item">
                                <label>就业状态</label>
                                <select id="statusFilter">
                                    <option>全部状态</option>
                                    <option>已就业</option>
                                    <option>待就业</option>
                                    <option>继续深造</option>
                                    <option>自主创业</option>
                                </select>
                            </div>
                            
                            <div class="search-bar">
                                <input type="text" placeholder="搜索学生、企业或职位...">
                                <button><i class="fas fa-search"></i></button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 统计卡片 -->
                    <div class="stats-cards">
                        <div class="stat-card animated">
                            <div class="stat-title">
                                <i class="fas fa-users"></i>
                                <span>学生总数</span>
                            </div>
                            <div class="stat-value" id="totalStudents">1,248</div>
                            <div class="stat-change positive">
                                <i class="fas fa-arrow-up"></i>
                                <span>12.5% 同比增长</span>
                            </div>
                        </div>
                        
                        <div class="stat-card animated delay-1">
                            <div class="stat-title">
                                <i class="fas fa-briefcase"></i>
                                <span>就业率</span>
                            </div>
                            <div class="stat-value" id="employmentRate">94.7%</div>
                            <div class="stat-change positive">
                                <i class="fas fa-arrow-up"></i>
                                <span>3.2% 同比增长</span>
                            </div>
                        </div>
                        
                        <div class="stat-card animated delay-2">
                            <div class="stat-title">
                                <i class="fas fa-money-bill-wave"></i>
                                <span>平均薪资</span>
                            </div>
                            <div class="stat-value" id="avgSalary">¥15,800</div>
                            <div class="stat-change positive">
                                <i class="fas fa-arrow-up"></i>
                                <span>8.3% 同比增长</span>
                            </div>
                        </div>
                        
                        <div class="stat-card animated delay-3">
                            <div class="stat-title">
                                <i class="fas fa-university"></i>
                                <span>深造率</span>
                            </div>
                            <div class="stat-value" id="higherEduRate">18.2%</div>
                            <div class="stat-change positive">
                                <i class="fas fa-arrow-up"></i>
                                <span>2.1% 同比增长</span>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 图表区域 -->
                    <div class="charts-container">
                        <div class="chart-card animated">
                            <div class="chart-header">
                                <div class="chart-title">就业率趋势分析</div>
                            </div>
                            <canvas id="employmentRateChart"></canvas>
                        </div>
                        
                        <div class="chart-card animated delay-1">
                            <div class="chart-header">
                                <div class="chart-title">行业分布分析</div>
                            </div>
                            <canvas id="industryDistributionChart"></canvas>
                        </div>
                        
                        <div class="chart-card animated delay-2">
                            <div class="chart-header">
                                <div class="chart-title">薪资区间分布</div>
                            </div>
                            <canvas id="salaryDistributionChart"></canvas>
                        </div>
                        
                        <div class="chart-card animated delay-3">
                            <div class="chart-header">
                                <div class="chart-title">就业趋势预测</div>
                            </div>
                            <canvas id="trendPredictionChart"></canvas>
                        </div>
                    </div>
                    
                    <!-- 学生就业数据 -->
                    <div class="data-section">
                        <div class="section-header">
                            <div class="section-title">
                                <i class="fas fa-table"></i>
                                <span id="dataTableTitle">学生就业信息</span>
                            </div>
                            <div class="section-actions">
                                <button>
                                    <i class="fas fa-download"></i> 导出数据
                                </button>
                                <button>
                                    <i class="fas fa-sync-alt"></i> 刷新数据
                                </button>
                            </div>
                        </div>
                        <div class="data-table-container">
                            <table class="data-table">
                                <thead>
                                    <tr>
                                        <th>学号</th>
                                        <th>姓名</th>
                                        <th>专业</th>
                                        <th>班级</th>
                                        <th>就业状态</th>
                                        <th>就业企业</th>
                                        <th>职位</th>
                                        <th>月薪(元)</th>
                                        <th>就业城市</th>
                                    </tr>
                                </thead>
                                <tbody id="employmentData">
                                    <!-- 数据将通过JS动态生成 -->
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // 模拟数据 - 学生就业信息（120条记录）
        const employmentData = [];
        const majors = ['计算机科学与技术', '软件工程', '人工智能', '数据科学', '电子信息工程', '网络工程', '物联网工程'];
        const classes = ['计算机2001', '计算机2002', '软件2001', '软件2002', '人工智能2001', '数据2001', '电子2001'];
        const companies = ['华为', '腾讯', '阿里巴巴', '字节跳动', '百度', '京东', '美团', '拼多多', '小米', '网易', '滴滴', '快手', 'B站', '商汤科技', '旷视科技', '大疆创新', '清华大学', '北京大学', '复旦大学', '上海交通大学', '中国科学院'];
        const positions = ['软件工程师', '前端开发', '后端开发', '全栈工程师', '算法工程师', '数据分析师', '产品经理', 'UI设计师', '测试工程师', '运维工程师', '项目经理', '技术总监', '研究生', '博士生'];
        const cities = ['北京', '上海', '深圳', '广州', '杭州', '南京', '成都', '武汉', '西安', '苏州'];
        const statuses = ['已就业', '待就业', '继续深造', '自主创业'];
        
        // 生成120条学生就业记录
        for (let i = 1; i <= 120; i++) {
            const status = statuses[Math.floor(Math.random() * statuses.length)];
            const salary = status === '已就业' ? Math.floor(Math.random() * 15000) + 8000 : 0;
            const company = status === '已就业' ? companies[Math.floor(Math.random() * companies.length)] : 
                          status === '继续深造' ? companies.slice(17, 21)[Math.floor(Math.random() * 4)] : '';
            const position = status === '已就业' ? positions[Math.floor(Math.random() * 10)] : 
                           status === '继续深造' ? positions[12] : 
                           status === '自主创业' ? positions[13] : '';
            
            employmentData.push({
                id: `2021${String(i).padStart(3, '0')}`,
                name: `学生${i}`,
                major: majors[Math.floor(Math.random() * majors.length)],
                class: classes[Math.floor(Math.random() * classes.length)],
                status: status,
                company: company,
                position: position,
                salary: salary,
                city: status === '已就业' ? cities[Math.floor(Math.random() * cities.length)] : ''
            });
        }
        
        // 模拟数据 - 就业率趋势
        const employmentRateData = {
            labels: ['1月', '2月', '3月', '4月', '5月', '6月', '7月'],
            datasets: [{
                label: '2023年就业率',
                data: [65, 72, 78, 82, 86, 90, 92],
                borderColor: '#3498db',
                backgroundColor: 'rgba(52, 152, 219, 0.1)',
                tension: 0.3,
                fill: true
            }, {
                label: '2024年就业率',
                data: [68, 75, 81, 87, 90, 93, 95],
                borderColor: '#2ecc71',
                backgroundColor: 'rgba(46, 204, 113, 0.1)',
                tension: 0.3,
                fill: true
            }]
        };
        
        // 模拟数据 - 行业分布
        const industryData = {
            labels: ['互联网/IT', '金融', '教育', '制造业', '医疗健康', '其他'],
            datasets: [{
                data: [45, 18, 12, 10, 8, 7],
                backgroundColor: [
                    '#3498db', '#2ecc71', '#9b59b6', '#e74c3c', '#f39c12', '#7f8c8d'
                ]
            }]
        };
        
        // 模拟数据 - 薪资区间
        const salaryData = {
            labels: ['<8K', '8K-12K', '12K-16K', '16K-20K', '>20K'],
            datasets: [{
                label: '学生数量',
                data: [5, 25, 45, 30, 15],
                backgroundColor: '#3498db',
                borderColor: '#2980b9',
                borderWidth: 1
            }]
        };
        
        // 模拟数据 - 就业趋势预测
        const trendData = {
            labels: ['2024Q1', '2024Q2', '2024Q3', '2024Q4', '2025Q1', '2025Q2'],
            datasets: [{
                label: '预测就业率',
                data: [92, 93, 94, 95, 96, 97],
                borderColor: '#9b59b6',
                backgroundColor: 'rgba(155, 89, 182, 0.1)',
                tension: 0.3,
                fill: true
            }]
        };
        
        // 角色切换
        document.getElementById('studentRole').addEventListener('click', function() {
            document.getElementById('studentRole').classList.add('active');
            document.getElementById('teacherRole').classList.remove('active');
        });
        
        document.getElementById('teacherRole').addEventListener('click', function() {
            document.getElementById('teacherRole').classList.add('active');
            document.getElementById('studentRole').classList.remove('active');
        });
        
        // 登录功能
        function login() {
            const username = document.getElementById('username').value;
            const password = document.getElementById('password').value;
            
            if (!username || !password) {
                alert('请输入用户名和密码');
                return;
            }
            
            if (password !== '123456') {
                alert('密码错误，请使用初始密码123456');
                return;
            }
            
            // 模拟JWT认证
            const isTeacher = document.getElementById('teacherRole').classList.contains('active');
            const userData = {
                name: isTeacher ? '张教授' : '李同学',
                role: isTeacher ? '教师' : '学生',
                college: isTeacher ? '计算机学院' : '软件工程',
                class: isTeacher ? '' : '软件2002',
                id: username
            };
            
            // 模拟JWT存储
            localStorage.setItem('jwt_token', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c');
            localStorage.setItem('user_data', JSON.stringify(userData));
            
            // 切换到主应用
            document.getElementById('loginPanel').classList.add('hidden');
            document.getElementById('mainApp').classList.remove('hidden');
            
            // 更新用户信息
            document.getElementById('currentUserName').textContent = userData.name;
            document.getElementById('currentUserRole').textContent = 
                isTeacher ? `${userData.college} - 教授` : `${userData.college} - ${userData.class}`;
            
            // 更新页面标题
            document.getElementById('pageTitle').textContent = 
                isTeacher ? '就业信息管理' : '我的就业信息';
            document.getElementById('dataTableTitle').textContent = 
                isTeacher ? '学生就业信息' : '我的就业信息';
            
            // 如果是学生，隐藏教师筛选器
            if (!isTeacher) {
                document.getElementById('teacherFilters').style.display = 'none';
                // 只显示当前学生的信息
                const studentData = employmentData.find(s => s.id === username) || employmentData[0];
                renderEmploymentTable([studentData]);
            } else {
                renderEmploymentTable(employmentData);
            }
            
            initCharts();
        }
        
        // 退出登录
        function logout() {
            localStorage.removeItem('jwt_token');
            localStorage.removeItem('user_data');
            document.getElementById('loginPanel').classList.remove('hidden');
            document.getElementById('mainApp').classList.add('hidden');
            document.getElementById('username').value = '';
            document.getElementById('password').value = '';
        }
        
        // 渲染学生就业数据表格
        function renderEmploymentTable(data) {
            const tableBody = document.getElementById('employmentData');
            tableBody.innerHTML = '';
            
            data.forEach(student => {
                const row = document.createElement('tr');
                
                // 根据就业状态设置样式
                let statusClass = '';
                let statusText = '';
                
                switch(student.status) {
                    case '已就业':
                        statusClass = 'status-employed';
                        statusText = '已就业';
                        break;
                    case '待就业':
                        statusClass = 'status-job-seeking';
                        statusText = '待就业';
                        break;
                    case '继续深造':
                        statusClass = 'status-higher-edu';
                        statusText = '继续深造';
                        break;
                    case '自主创业':
                        statusClass = 'status-entrepreneur';
                        statusText = '自主创业';
                        break;
                    default:
                        statusClass = 'status-job-seeking';
                        statusText = '待就业';
                }
                
                row.innerHTML = `
                    <td>${student.id}</td>
                    <td>${student.name}</td>
                    <td>${student.major}</td>
                    <td>${student.class}</td>
                    <td><span class="status-badge ${statusClass}">${statusText}</span></td>
                    <td>${student.company || '-'}</td>
                    <td>${student.position || '-'}</td>
                    <td>${student.salary > 0 ? student.salary.toLocaleString() : '-'}</td>
                    <td>${student.city || '-'}</td>
                `;
                
                tableBody.appendChild(row);
            });
        }
        
        // 初始化图表
        function initCharts() {
            // 就业率趋势图
            new Chart(
                document.getElementById('employmentRateChart'),
                {
                    type: 'line',
                    data: employmentRateData,
                    options: {
                        responsive: true,
                        maintainAspectRatio: false,
                        plugins: {
                            legend: {
                                position: 'top',
                            },
                            title: {
                                display: false
                            }
                        },
                        scales: {
                            y: {
                                min: 50,
                                max: 100,
                                ticks: {
                                    callback: function(value) {
                                        return value + '%';
                                    }
                                }
                            }
                        }
                    }
                }
            );
            
            // 行业分布图
            new Chart(
                document.getElementById('industryDistributionChart'),
                {
                    type: 'doughnut',
                    data: industryData,
                    options: {
                        responsive: true,
                        maintainAspectRatio: false,
                        plugins: {
                            legend: {
                                position: 'right',
                            }
                        }
                    }
                }
            );
            
            // 薪资区间图
            new Chart(
                document.getElementById('salaryDistributionChart'),
                {
                    type: 'bar',
                    data: salaryData,
                    options: {
                        responsive: true,
                        maintainAspectRatio: false,
                        plugins: {
                            legend: {
                                display: false
                            }
                        },
                        scales: {
                            y: {
                                beginAtZero: true
                            }
                        }
                    }
                }
            );
            
            // 就业趋势预测图
            new Chart(
                document.getElementById('trendPredictionChart'),
                {
                    type: 'line',
                    data: trendData,
                    options: {
                        responsive: true,
                        maintainAspectRatio: false,
                        plugins: {
                            legend: {
                                position: 'top',
                            }
                        },
                        scales: {
                            y: {
                                min: 90,
                                max: 100,
                                ticks: {
                                    callback: function(value) {
                                        return value + '%';
                                    }
                                }
                            }
                        }
                    }
                }
            );
        }
        
        // 页面加载后初始化
        window.onload = function() {
            // 检查是否有JWT token（模拟）
            if (localStorage.getItem('jwt_token')) {
                document.getElementById('loginPanel').classList.add('hidden');
                document.getElementById('mainApp').classList.remove('hidden');
                
                // 加载用户数据
                const userData = JSON.parse(localStorage.getItem('user_data'));
                if (userData) {
                    document.getElementById('currentUserName').textContent = userData.name;
                    document.getElementById('currentUserRole').textContent = 
                        userData.role === '教师' ? 
                        `${userData.college} - 教授` : 
                        `${userData.college} - ${userData.class}`;
                    
                    // 设置页面标题
                    document.getElementById('pageTitle').textContent = 
                        userData.role === '教师' ? '就业信息管理' : '我的就业信息';
                    document.getElementById('dataTableTitle').textContent = 
                        userData.role === '教师' ? '学生就业信息' : '我的就业信息';
                    
                    // 如果是学生，隐藏教师筛选器
                    if (userData.role === '学生') {
                        document.getElementById('teacherFilters').style.display = 'none';
                        // 只显示当前学生的信息
                        const studentData = employmentData.find(s => s.id === userData.id) || employmentData[0];
                        renderEmploymentTable([studentData]);
                    } else {
                        renderEmploymentTable(employmentData);
                    }
                    
                    initCharts();
                }
            } else {
                // 初始显示登录界面
                document.getElementById('loginPanel').classList.remove('hidden');
                document.getElementById('mainApp').classList.add('hidden');
            }
        };
    </script>
</body>
</html>